clear all


use ../Data/Clean/cleaned_recruiter_data.dta, clear
drop if hiringmanagerisempty==1
gen count=1

bysort hiringmanagerid: egen temp_sum=sum(pacceptjoboffer)
bysort hiringmanagerid: egen num_evals=sum(count)
gen mgr_quality_jk=(temp_sum-pacceptjoboffer)/(num_evals-1)
drop temp_sum num_evals
* TABLE 3 BOTTOM LEFT
reg pacceptjoboffer mgr_quality_jk, cluster(screenerid)

bysort candidateid: egen temp_sum=sum(ppassinterview)
bysort candidateid: egen num_evals=sum(count)
gen cand_quality_jk=(temp_sum-ppassinterview)/(num_evals-1)
drop temp_sum num_evals
* TABLE 3 BOTTOM RIGHT
reg ppassinterview cand_quality_jk, cluster(hiringmanagerid)

* TABLE 4 FIRST ROW
pwcorr pacceptjoboffer ppassinterview, sig

* TABLE 4 SECOND ROW
reg pacceptjoboffer ppassinterview, cluster(screenerid)

* TABLE 4 THIRD ROW
* Calculating ranks
gen temp=0
replace temp=-ppassinterview
sort screenerid temp, stable
by screenerid: gen mgr_pref_rank=_n

replace temp=-pacceptinterview
sort candidateid temp, stable
by candidateid: gen cand_pref_rank=_n

gen mgr_above_half=mgr_pref_rank>8
gen cand_above_half=cand_pref_rank>8
reg mgr_above_half if cand_above_half, cluster(screenerid)
